<?php
/**
 * 栈输出相关
 */
require 'StackStruct.php';
$stack = new StackStruct();
$stack->push('aa');
$stack->push('bb');
$stack->push('cc');
$stack->push('dd');
$stack->push('ee');
$stack->push('ff');
$stack->push('gg');
$stack->push('hh');

echo $stack->peek(); //查看栈顶元素，打印 hh
echo $stack->toString(); //打印栈数据 [aa,bb,cc,dd,ee,ff,gg,hh

echo $stack->pop();  //出栈，打印 hh
echo $stack->toString(); //打印栈数据 [aa,bb,cc,dd,ee,ff,gg






